import 'package:flutter/material.dart';
import 'package:mpflutter_template/demo/color_constant.dart';
import 'package:mpflutter_template/demo/icon_config_default.dart';

//寄件
class PostCardWidget extends StatelessWidget {
  bool hasSend = false;
  bool hasReceive = false;
  @override
  Widget build(BuildContext context) {
    return Container(
      color: ColorConstant.white,
      child: Column(
        children: [
          Container(
            height: 60,
            margin: const EdgeInsets.only(left: 12, right: 12, top: 12),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Container(
                    margin: const EdgeInsets.only(left: 12, right: 8),
                    child: Image.asset(
                      IconAssetsDefault.ivSend,
                      width: 24,
                      height: 24,
                    )),
                hasSend
                    ? Text(
                        "请填写寄件人信息",
                        style: TextStyle(
                            fontSize: 14,
                            fontWeight: FontWeight.bold,
                            color: ColorConstant.ff333333),
                      )
                    : Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Row(
                            children: [
                              Text(
                                "张三",
                                style: TextStyle(
                                    fontSize: 12,
                                    fontWeight: FontWeight.bold,
                                    fontStyle: FontStyle.normal,
                                    color: ColorConstant.ff333333),
                                maxLines: 1,
                                overflow: TextOverflow.ellipsis,
                              ),
                              Text(
                                "156****2615",
                                style: TextStyle(
                                    fontSize: 14,
                                    fontWeight: FontWeight.bold,
                                    color: ColorConstant.ff333333),
                              )
                            ],
                          ),
                          Text(
                            "深圳市南山区桃园街道家乐福2栋",
                            style: TextStyle(
                                fontSize: 12,
                                fontWeight: FontWeight.bold,
                                color: ColorConstant.ff333333),
                            maxLines: 1,
                            overflow: TextOverflow.ellipsis,
                          )
                        ],
                      ),
                Container(
                    margin: const EdgeInsets.only(left: 4),
                    child: Image.asset(
                      IconAssetsDefault.ivArrowBig,
                      width: 16,
                      height: 16,
                    ))
              ],
            ),
          ),
          Container(
            height: 60,
            margin: const EdgeInsets.only(left: 12, right: 12),
            decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(8),
                border: Border.all(color: ColorConstant.ff84bad8, width: 1.5),
                gradient: LinearGradient(
                    stops: [0.0, 1.0],
                    colors: [ColorConstant.ff94db97, ColorConstant.ff84bad8])),
            child: Row(
              children: [
                Container(
                    margin: const EdgeInsets.only(left: 12, right: 8),
                    child: Image.asset(
                      IconAssetsDefault.ivReceive,
                      width: 24,
                      height: 24,
                    )),
                hasReceive
                    ? Text(
                        "请填写收件人信息",
                        style: TextStyle(
                            fontSize: 14,
                            fontWeight: FontWeight.bold,
                            color: ColorConstant.ff333333),
                      )
                    : Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Row(
                            children: [
                              Text(
                                "张三",
                                style: TextStyle(
                                    fontSize: 12,
                                    fontWeight: FontWeight.bold,
                                    fontStyle: FontStyle.normal,
                                    color: ColorConstant.ff333333),
                                maxLines: 1,
                                overflow: TextOverflow.ellipsis,
                              ),
                              Text(
                                "156****2615",
                                style: TextStyle(
                                    fontSize: 14,
                                    fontWeight: FontWeight.bold,
                                    color: ColorConstant.ff333333),
                              )
                            ],
                          ),
                          Text(
                            "深圳市南山区桃园街道家乐福2栋",
                            style: TextStyle(
                                fontSize: 12,
                                fontWeight: FontWeight.bold,
                                color: ColorConstant.ff333333),
                            maxLines: 1,
                            overflow: TextOverflow.ellipsis,
                          )
                        ],
                      ),
                Container(
                    margin: const EdgeInsets.only(left: 4),
                    child: Image.asset(
                      IconAssetsDefault.ivArrowBig,
                      width: 16,
                      height: 16,
                    )),
                Container(
                  width: 60,
                  height: 28,
                  margin: const EdgeInsets.only(left: 25),
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(4),
                      color: ColorConstant.ff86d026,
                      border: Border.all(
                          color: ColorConstant.ff6386cf26, width: 0.5)),
                  child: Text(
                    "去下单",
                    style: TextStyle(
                        fontSize: 12,
                        fontWeight: FontWeight.bold,
                        color: ColorConstant.white),
                  ),
                )
              ],
            ),
          ),
          Container(
            height: 40,
            child: ListView.builder(
                itemCount: 10,
                itemExtent: 40,
                scrollDirection: Axis.horizontal,
                itemBuilder: (context, index) {
                  return Container(
                    width: 40,
                    height: 40,
                    child: Image.network(
                        "https://consumerapp-1251779293.image.myqcloud.com/discovery/202208/wzdija6c7uj.png"),
                  );
                }),
          )
        ],
      ),
    );
  }
}
